﻿<form nz-form #articleCategoryCreateOrEditForm="ngForm" (ngSubmit)="save()" autocomplete="off">
    <div class="modal-header">
        <div class="modal-title">
            <i nz-icon type="medicine-box" class="mr-sm"></i>
            <span *ngIf="articleCategoryId">编辑文章类别</span>
            <span *ngIf="!articleCategoryId">新增文章类别</span>
        </div>
    </div>
    <fieldset>
        <nz-form-item nz-row>
            <nz-form-label [nzSm]="4" nzFor="CategoryNameInput" nzRequired>
                 类别名称
            </nz-form-label>
            <nz-form-control [nzSm]="20" nzHasFeedback>
                <input nz-input #categoryNameInput="ngModel" name="CategoryName" [(ngModel)]="articleCategory.categoryName"
                       placeholder="请输入 类别名称" required maxlength="50">
                <nz-form-explain *ngIf="categoryNameInput.dirty && categoryNameInput.errors">
                    <validation-messages [formCtrl]="categoryNameInput"></validation-messages>
                </nz-form-explain>
            </nz-form-control>
        </nz-form-item>
        <nz-form-item nz-row>
            <nz-form-label [nzSm]="4" nzFor="RemarkInput" >
                 备注
            </nz-form-label>
            <nz-form-control [nzSm]="20" nzHasFeedback>
                <input nz-input #remarkInput="ngModel" name="Remark" [(ngModel)]="articleCategory.remark"
                       placeholder="请输入 备注"  maxlength="100">
                <nz-form-explain *ngIf="remarkInput.dirty && remarkInput.errors">
                    <validation-messages [formCtrl]="remarkInput"></validation-messages>
                </nz-form-explain>
            </nz-form-control>
        </nz-form-item>
    </fieldset>
    <div class="modal-footer">
        <button nz-button [nzType]="'default'" type="button" (click)="close($event)" [disabled]="saving">
            {{"Cancel" | localize}}
        </button>
        <button nz-button [nzType]="'primary'" type="submit" [disabled]="!articleCategoryCreateOrEditForm.form.valid|| saving"
                [nzLoading]="saving">
            <i nz-icon type="save" *ngIf="!saving"></i> {{"Save" | localize}}
        </button>
    </div>
</form>
